package cn.tedu.boyou.common.query;

import cn.tedu.boyou.common.util.TravelCondition;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class TravelQuery extends QueryObject{
    private Long destId = -1L;

    private int state = -1;//状态

    //最新最热
    private int orderType = -1;
    private String order ;
    public String getOrder() {
        if(orderType == 1){
            return "t.createTime desc";
        }
        return "t.viewnum desc" ;
    }

    //人均消费
    private int perExpendType = -1;
    private TravelCondition perExpends;
    //出游天数
    private int dayType = -1;
    private TravelCondition days;

    //出游月份
    private int travelTimeType = -1;
    private TravelCondition travelTime;

    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTime);
    }

    public TravelCondition getDays(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }
    public TravelCondition getPerExpends(){
        return TravelCondition.TRAVEL_PRE_EXPENDS.get(perExpendType);
    }
}
